package com.xuecheng.content.controller;

import com.xuecheng.commons.model.dto.BindTeachplanMediaDto;
import com.xuecheng.commons.model.vo.ResponseResult;
import org.springframework.web.bind.annotation.*;
import com.xuecheng.content.service.TeachplanMediaService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author itheima
 */
@Slf4j
@RestController
public class TeachplanMediaController {

    @Autowired
    private TeachplanMediaService  teachplanMediaService;
    //课程计划绑定媒资
    @PostMapping("/teachplan/media/association")
    public ResponseResult associationMediaWithTeachMedia(@RequestBody BindTeachplanMediaDto dto){
        return teachplanMediaService.associationMediaWithTeachMedia(dto);

    }
    //删除课程计划媒资
    @DeleteMapping("/teachplan/media/{teachPlanMediaId}")
    public ResponseResult deleteTeachMedia(@PathVariable("teachPlanMediaId")Integer teachPlanMediaId){
        return teachplanMediaService.deleteTeachMedia(teachPlanMediaId);

    }

}
